package com.hhs.storage.controller;


import com.hhs.storage.bean.Img;
import com.hhs.storage.bean.ResponseInfo;
import com.hhs.storage.service.BaseLogsService;
import com.hhs.storage.service.ImgService;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 图片处理
 * @author hhs
 * @since 2022-12-01
 */
@RestController
@RequestMapping("/img")
public class ImgController {
    @Resource
    private BaseLogsService baseLogsService;
    @Resource
    ImgService imgService;
    @RequestMapping(value = "getByMain")
    public Map<String, Object> getByMain(Img img) {

        List<Img> list = imgService.getByMainId(img);
        return ResponseInfo.success(list);
    }

    @RequestMapping("editor")
    @ResponseBody
    public Map upload( MultipartFile file  ){
        Map map = imgService.editorUpload(file);
        return map;
    }
}

